<script type="text/javascript">
var _d = DialogManager.get('config_dialog');
_d.setWidth(540);
$(function(){
	arr = new Array();
	arr['left'] = '34%';
	arr['top']  = '100px';
	_d.setPosition(arr);
});
	
function loadImage(obj){
    getTempPath(obj,function(res){
        $(obj).parent().find('img').attr('src',res);
    });
}
</script>
<div class="field_item webkit-box file-box box-align-center">
    <label>上传图片</label>
    <p class="relative">
        <input class="file absolute pointer" type="file" name="ad_image_file" onchange="loadImage(this)" />
        <input type="hidden" name="ad_image_url" value="{$options.ad_image_url}" />
        <img src="{if $options.ad_image_url}{$options.ad_image_url|url_format}{else}{res file='images/upload.png'}{/if}"/>
    </p>
    <font class="ml10 fs12" color="gray">点击图片上传，支持 gif|jpg|jpeg|png 格式</font>
</div>
<div class="field_item webkit-box">
    <label>链接地址</label>
    <p><input type="text" name="ad_link_url" value="{$options.ad_link_url}" /></p>
</div>
<div class="field_item webkit-box">
    <label>图片宽度</label>
    <p><input type="text" name="width" value="{$options.width}" /> px</p>
</div>
<div class="field_item webkit-box">
    <label>图片高度</label>
    <p><input type="text" name="height" value="{$options.height}" /> px</p>
</div>
<div class="field_item webkit-box">
    <label>外边框</label>
    <p><input type="text" name="border" value="{$options.border}" /> px</p>
</div>
<div class="field_item webkit-box">
    <label>外边距</label>
    <p><input type="text" name="margin" value="{$options.margin}" /><font class="ml5 fs12" color="gray">margin值，如10px 10px 10px 10px</font></p>
</div>
<div class="field_item webkit-box">
    <label>背景颜色</label>
    <p><input type="text" name="background" value="{$options.background}" /><font class="ml5 fs12" color="gray">颜色值，如：#FF6600</font></p>
</div>
<div class="field_item webkit-box">
    <label>关闭按钮</label>
    <p>
    	<select name="closeButton">
        	<option value="0" {if !$options.closeButton} selected="selected"{/if}>不显示</option>
            <option value="1" {if $options.closeButton eq 1} selected="selected"{/if}>显示</option>
        </select>
    </p>
</div>